﻿using System;

namespace dPet.Domain.Models
{
	using Hangerd;
	using Hangerd.Entity;

	public class ServiceOrderLine : EntityBase
	{
		#region Public Properties

		/// <summary>
		/// 服务项名称
		/// </summary>
		public string ServiceItemName { get; private set; }

		/// <summary>
		/// SKU属性值名称集合
		/// </summary>
		public string SKUPropertyValueNames { get; private set; }

		/// <summary>
		/// 服务项单价
		/// </summary>
		public decimal UnitPrice { get; private set; }

		/// <summary>
		/// 数量
		/// </summary>
		public int Quantity { get; private set; }
	
		#endregion

		#region Constructors

		private ServiceOrderLine() { }

		public ServiceOrderLine(ServiceItemSKU sku, int quantity)
		{
			if (quantity < 1)
			{
				throw new HangerdException("服务项 [{0}] 数量不可小于1", sku.ServiceItem.Name);
			}

			this.ServiceItemName = sku.ServiceItem.Name;
			this.SKUPropertyValueNames = sku.SKUPropertyValueNames;
			this.UnitPrice = sku.UnitPrice;
			this.Quantity = quantity;
		}

		#endregion

		#region Public Methods

		#endregion
	}
}
